package com.minigame.common;

import cn.hutool.core.text.StrFormatter;
import lombok.Getter;
import lombok.NoArgsConstructor;

@NoArgsConstructor
@Getter
public class ApiException extends RuntimeException {
    private int code;
    private String message;
    public ApiException(ErrorTemplateEnum errorTemplateEnum, Object... args) {
        this.code = errorTemplateEnum.getCode();
        this.message = StrFormatter.format(errorTemplateEnum.getTemplate(), args);
    }
}
